GlyphRun contains the memory structures that are needed to render a text string.
More...
#include <kanzi/core.ui/text/glyph_run.hpp>
|
| void | allocateClippingCoordinates () |
| | Allocates the space for the clipping coordinates.
|
| |
| void | draw (Renderer &renderer, bool twoPass, GlRenderState &renderState) |
| | Renders the glyph run.
|
| |
| RectangleFloat | getBoundingRectangle () const |
| | Returns the bounding box for the whole glyph run, with clipping.
|
| |
| RectangleFloat | getCharacterBounds (size_t glyphRunIndex) const |
| | Returns the unclipped bounding box for the given glyph, as set by setCharacterBounds().
|
| |
| TextureSharedPtr | getTexture () const |
| | Returns the glyph cache texture.
|
| |
| | GlyphRun (Domain *domain, size_t capacity, GlyphCache &glyphCache) |
| | Constructs a glyph run with given maximum capacity.
|
| |
| void | setCharacterBounds (size_t glyphRunIndex, float left, float top, float right, float bottom) |
| | Sets the unclipped bounding box for a glyph at the given index.
|
| |
| void | setClippingCoordinates (size_t glyphRunIndex, float left, float top, float right, float bottom) |
| | Sets the clipping coordinates for a glyph at the given index.
|
| |
| void | setGlyph (unsigned int glyphRunIndex, const GlyphKey &glyphKey) |
| | Sets the font glyph index for the given glyph.
|
| |
| void | setLength (unsigned int length) |
| | Sets the actual length of the glyph run.
|
| |
| void | setVertexCoordinates (size_t glyphRunIndex, float left, float top, float right, float bottom) |
| | Sets the vertex coordinates for the given index, based on the given edges.
|
| |
| | ~GlyphRun ()=default |
| | Destructor.
|
| |
GlyphRun contains the memory structures that are needed to render a text string.
◆ GlyphRun()
| kanzi::GlyphRun::GlyphRun |
( |
Domain * | domain, |
|
|
size_t | capacity, |
|
|
GlyphCache & | glyphCache ) |
|
explicit |
Constructs a glyph run with given maximum capacity.
- Parameters
-
| domain | Domain to use. |
| capacity | Defines the maximum amount of glyphs that can be included in the run. |
| glyphCache | Glyph cache containing the characters. |
- Since
- Kanzi 4.0.0
- Changed the type of the capacity parameter to size_t.
- Added the glyphCache parameter.
◆ ~GlyphRun()
| kanzi::GlyphRun::~GlyphRun |
( |
| ) |
|
|
default |
◆ draw()
Renders the glyph run.
- Parameters
-
| renderer | Renderer to use for drawing. |
| twoPass | True for separate color and depth render passes, false for a single pass. |
| renderState | Render State used for rendering. |
- Since
- Kanzi 4.0.0
- Changed the
material parameter to renderState.
- Changed the type of the
renderer parameter to Renderer&.
- Removed the glyphCache parameter.
◆ setVertexCoordinates()
Sets the vertex coordinates for the given index, based on the given edges.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| left | Left edge x axis coordinate. |
| top | Top edge y axis coordinate. |
| right | Right edge x axis coordinate. |
| bottom | Bottom edge y axis coordinate. |
- Since
- Kanzi 4.0.0 changed the type of the glyphRunIndex parameter to size_t.
◆ setCharacterBounds()
Sets the unclipped bounding box for a glyph at the given index.
Used to calculate final clipped vertex coordinates.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| left | Left edge x axis coordinate. |
| top | Top edge y axis coordinate. |
| right | Right edge x axis coordinate. |
| bottom | Bottom edge y axis coordinate. |
- Since
- Kanzi 4.0.0 changed the type of the glyphRunIndex parameter to size_t.
◆ setClippingCoordinates()
Sets the clipping coordinates for a glyph at the given index.
For each quad there are 4 floats in range[0, 1]: left, right, bottom, and top. For example, a left value of 0.1 and a right value of 0.25 means that one tenth of the glyph is being clipped from the left side and a quarter of the glyph is being clipped from the right side.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| left | Left edge clipping amount. |
| top | Top edge clipping amount. |
| right | Right edge clipping amount. |
| bottom | Bottom edge clipping amount. |
- Since
- Kanzi 4.0.0 changed the type of the glyphRunIndex parameter to size_t.
◆ setGlyph()
Sets the font glyph index for the given glyph.
Use this function to retrieve texture coordinates.
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
| glyphKey | GlyphKey of the glyph in the used font. |
◆ setLength()
Sets the actual length of the glyph run.
- Parameters
-
| length | Length of the run. The length must be smaller than or equal to the available length. |
◆ allocateClippingCoordinates()
| void kanzi::GlyphRun::allocateClippingCoordinates |
( |
| ) |
|
Allocates the space for the clipping coordinates.
◆ getBoundingRectangle()
Returns the bounding box for the whole glyph run, with clipping.
- Returns
- Bounding box containing all the glyphs.
◆ getCharacterBounds()
| RectangleFloat kanzi::GlyphRun::getCharacterBounds |
( |
size_t | glyphRunIndex | ) |
const |
Returns the unclipped bounding box for the given glyph, as set by setCharacterBounds().
- Parameters
-
| glyphRunIndex | Index of the glyph in the glyph run. |
- Returns
- Bounding box for the glyph.
- Since
- Kanzi 4.0.0 changed the type of the glyphRunIndex parameter to size_t.
◆ getTexture()
Returns the glyph cache texture.
- Returns
- The texture of the glyph cache.
- Since
- Kanzi 4.0.0
The documentation for this class was generated from the following file: